package com.ryskoo.customer.vendorbasic.domain;

import com.ryskoo.framework.core.bean.BasicPO;
import org.springframework.util.StringUtils;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

/**
 * 商户基础设置
 * 包括商户的5张广告图，是否支持外卖，外卖配送信息
 * @author thq
 *
 */
@Entity
@Table(name = "cater_vendor_basic")
public class VendorBasicPO extends BasicPO {

	private static final long serialVersionUID = 1L;
	
	/* 所属商户uuid */
	@Column(name = "vendor_id",columnDefinition = "char",length = 32)
	private String vendorId;
	
	/* 广告图1 */
	@Column(name = "advert1", length = 200)
	private String advert1;
	
	/* 广告图2 */
	@Column(name = "advert2", length = 200)
	private String advert2;
	
	/* 广告图3 */
	@Column(name = "advert3", length = 200)
	private String advert3;
	
	/* 广告图4 */
	@Column(name = "advert4", length = 200)
	private String advert4;
	
	/* 广告图5 */
	@Column(name = "advert5", length = 200)
	private String advert5;
	
	/* 是否支持外卖 */
    @Column(name = "support_out")
    private boolean supportOut = true;
    
    
	/* 是否展示招牌分类 */
    @Column(name = "show_sign")
    private boolean showSign = false;
    
	/* 是否展示优惠分类 */
    @Column(name = "show_promotion")
    private boolean showPromotion = false;
	
	/* 配送范围，距离店铺多少公里 */
    @Column(name = "support_scope",columnDefinition="DECIMAL")
    private double supportScope;
    
	/* 配送费用 */
    @Column(name = "distribution_price",columnDefinition="DECIMAL")
    private double distributionPrice;
    
	/* 起送金额 */
    @Column(name = "least_price",columnDefinition="DECIMAL")
    private double leastPrice;
    
	/* 满额免运费 */
    @Column(name = "reach_price",columnDefinition="DECIMAL")
    private double reachPrice;
    
	/** 配送开始时间  时分格式，如：09:00  */
	@Column(name = "begin_time", columnDefinition = "char(5)", length = 5)
	private String beginTime;
	
	/** 配送结束时间  时分格式，如：23:00  */
	@Column(name = "end_time", columnDefinition = "char(5)", length = 5)
	private String endTime;
	
	/* 餐具费用 */
    @Column(name = "cover_price",columnDefinition="DECIMAL")
    private double coverPrice;
    
	/* 首页推荐分类id */
    @Column(name = "commend_categorys", length = 300)
    private String commendCategorys;
    
    /* 首页推荐商品1名称 */
    @Column(name = "product_name1", length = 50)
    private String productName1;
    
    /* 首页推荐商品2名称 */
    @Column(name = "product_name2", length = 50)
    private String productName2;
    
    /* 首页推荐商品3名称 */
    @Column(name = "product_name3", length = 50)
    private String productName3;
    
    /* 是否展示推荐商品1 */
    @Column(name = "show_products1", columnDefinition = "bit", length = 1)
    private boolean showProducts1 = false;
    
    /* 是否展示推荐商品2 */
    @Column(name = "show_products2", columnDefinition = "bit", length = 1)
    private boolean showProducts2 = false;
    
    /* 是否展示推荐商品3 */
    @Column(name = "show_products3", columnDefinition = "bit", length = 1)
    private boolean showProducts3 = false;
    
    /* 首页推荐商品1的 ids */
    @Column(name = "commend_products1",columnDefinition= "text")
    private String commendProducts1;
    
    /* 首页推荐商品2的 ids */
    @Column(name = "commend_products2",columnDefinition= "text")
    private String commendProducts2;
    
    /* 首页推荐商品3的 ids */
    @Column(name = "commend_products3",columnDefinition= "text")
    private String commendProducts3;
    
    /* 微信分享自定义 标题 */
    @Column(name = "share_title", length = 50)
    private String shareTitle;
    
    /* 微信分享自定义 内容 */
    @Column(name = "share_content", length = 128)
    private String shareContent;
    
    /* 微信分享自定义 图片 */
    @Column(name = "share_img", length = 200)
    private String shareImg;
    
    /* 店招 */
    @Column(name = "shop_inviting_img", length = 200)
    private String shopInvitingImg;
    
	/* 首页推荐分类名称 */
    @Transient
    private String commendCategoryNames;
    
	/* 广告图集合 */
    @Transient
    private List<String> adverts = new ArrayList<String>();

    
    
    
	public String getShopInvitingImg() {
		return shopInvitingImg;
	}

	public void setShopInvitingImg(String shopInvitingImg) {
		this.shopInvitingImg = shopInvitingImg;
	}

	public String getShareTitle() {
		return shareTitle;
	}

	public void setShareTitle(String shareTitle) {
		this.shareTitle = shareTitle;
	}

	public String getShareContent() {
		return shareContent;
	}

	public void setShareContent(String shareContent) {
		this.shareContent = shareContent;
	}

	public String getShareImg() {
		return shareImg;
	}

	public void setShareImg(String shareImg) {
		this.shareImg = shareImg;
	}

	public String getVendorId() {
		return vendorId;
	}

	public void setVendorId(String vendorId) {
		this.vendorId = vendorId;
	}

	public String getAdvert1() {
		return advert1;
	}

	public void setAdvert1(String advert1) {
		this.advert1 = advert1;
	}

	public String getAdvert2() {
		return advert2;
	}

	public void setAdvert2(String advert2) {
		this.advert2 = advert2;
	}

	public String getAdvert3() {
		return advert3;
	}

	public void setAdvert3(String advert3) {
		this.advert3 = advert3;
	}

	public String getAdvert4() {
		return advert4;
	}

	public void setAdvert4(String advert4) {
		this.advert4 = advert4;
	}

	public String getAdvert5() {
		return advert5;
	}

	public void setAdvert5(String advert5) {
		this.advert5 = advert5;
	}

	public boolean isSupportOut() {
		return supportOut;
	}

	public void setSupportOut(boolean supportOut) {
		this.supportOut = supportOut;
	}

	public double getSupportScope() {
		return supportScope;
	}

	public void setSupportScope(double supportScope) {
		this.supportScope = supportScope;
	}

	public double getDistributionPrice() {
		return distributionPrice;
	}

	public void setDistributionPrice(double distributionPrice) {
		this.distributionPrice = distributionPrice;
	}

	public double getLeastPrice() {
		return leastPrice;
	}

	public void setLeastPrice(double leastPrice) {
		this.leastPrice = leastPrice;
	}

	public double getReachPrice() {
		return reachPrice;
	}

	public void setReachPrice(double reachPrice) {
		this.reachPrice = reachPrice;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public double getCoverPrice() {
		return coverPrice;
	}

	public void setCoverPrice(double coverPrice) {
		this.coverPrice = coverPrice;
	}

	public List<String> getAdverts() {
		List<String> newList = new ArrayList<String>();
		if (!StringUtils.isEmpty(this.advert1)) {
			newList.add(this.advert1);
		}
		if (!StringUtils.isEmpty(this.advert2)) {
			newList.add(this.advert2);
		}
		if (!StringUtils.isEmpty(this.advert3)) {
			newList.add(this.advert3);
		}
		if (!StringUtils.isEmpty(this.advert4)) {
			newList.add(this.advert4);
		}
		if (!StringUtils.isEmpty(this.advert5)) {
			newList.add(this.advert5);
		}
		return newList;
	}

	public void setAdverts(List<String> adverts) {
		this.adverts = adverts;
	}

	public boolean isShowSign() {
		return showSign;
	}

	public void setShowSign(boolean showSign) {
		this.showSign = showSign;
	}

	public boolean isShowPromotion() {
		return showPromotion;
	}

	public void setShowPromotion(boolean showPromotion) {
		this.showPromotion = showPromotion;
	}

	public String getCommendCategorys() {
		return commendCategorys;
	}

	public void setCommendCategorys(String commendCategorys) {
		this.commendCategorys = commendCategorys;
	}

	public String getCommendCategoryNames() {
		return commendCategoryNames;
	}

	public void setCommendCategoryNames(String commendCategoryNames) {
		this.commendCategoryNames = commendCategoryNames;
	}

	public String getProductName1() {
		return productName1;
	}

	public void setProductName1(String productName1) {
		this.productName1 = productName1;
	}

	public String getProductName2() {
		return productName2;
	}

	public void setProductName2(String productName2) {
		this.productName2 = productName2;
	}

	public String getProductName3() {
		return productName3;
	}

	public void setProductName3(String productName3) {
		this.productName3 = productName3;
	}

	public boolean isShowProducts1() {
		return showProducts1;
	}

	public void setShowProducts1(boolean showProducts1) {
		this.showProducts1 = showProducts1;
	}

	public boolean isShowProducts2() {
		return showProducts2;
	}

	public void setShowProducts2(boolean showProducts2) {
		this.showProducts2 = showProducts2;
	}

	public boolean isShowProducts3() {
		return showProducts3;
	}

	public void setShowProducts3(boolean showProducts3) {
		this.showProducts3 = showProducts3;
	}

	public String getCommendProducts1() {
		return commendProducts1;
	}

	public void setCommendProducts1(String commendProducts1) {
		this.commendProducts1 = commendProducts1;
	}

	public String getCommendProducts2() {
		return commendProducts2;
	}

	public void setCommendProducts2(String commendProducts2) {
		this.commendProducts2 = commendProducts2;
	}

	public String getCommendProducts3() {
		return commendProducts3;
	}

	public void setCommendProducts3(String commendProducts3) {
		this.commendProducts3 = commendProducts3;
	}
	
}
